home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / System7 tools / Frontier / Stack suite.cpt / stack suite / DocServer Source Text next >
Text File  |  1992-03-11  |  2KB  |  67 lines

  1.  
  2. Verb    stack.create
  3. Syntax    stack.create ()
  4. Parameters    None.
  5. Action    Creates a new “last-in-first-out” stack with no elements in it.
  6. Returns    The address of the newly allocated stack object.
  7. Examples    scratchpad.nameStack = stack.create ()
  8.     « suites.stack.pool.stack1
  9. Notes    All stacks are created in a sub-table in the stack suite called "pool".
  10. A stack is a table with two items: top indicates how many elements are currently in the stack; vals is a sub-table that stores the stack values.
  11. See Also    stack.push
  12. stack.pop
  13. stack.dispose
  14. stack.visit
  15.  
  16. Verb    stack.push
  17. Syntax    stack.push (adrStack, val)
  18. Parameters    adrStack is the address of a stack object allocated by stack.create.
  19. val is any valid UserTalk expression.
  20. Action    Adds the value at the "top" of the stack.
  21. Returns    True.
  22. Examples    stack.push (scratchpad.nameStack, "Bull Mancuso")
  23.     « true
  24. See Also    stack.create
  25. stack.pop
  26. stack.dispose
  27. stack.visit
  28.  
  29. Verb    stack.pop
  30. Syntax    stack.pop (adrStack)
  31. Parameters    adrStack is the address of a stack object allocated by stack.create.
  32. Action    Deletes the top value on the stack and returns it.
  33. Returns    The value of the top element on the stack.
  34. Examples    stack.pop (scratchpad.nameStack)
  35.     « Bull Mancuso
  36. See Also    stack.create
  37. stack.push
  38. stack.dispose
  39. stack.visit
  40.  
  41. Verb    stack.visit
  42. Syntax    stack.visit (adrStack, callback)
  43. Parameters    adrStack is the address of a stack object allocated by stack.create.
  44. callback is the address of a script that will be called for each element in the stack.
  45. Action    Calls the callback script for each element in the stack.
  46. Returns    True if all the calls to the callback routine returned true.
  47. Examples    stack.visit (scratchpad.nameStack, @msg)
  48.     « true «displays the value of each stack element in Frontier’s main window.
  49. Notes    The callback routine receives exactly one parameter, the value of one of the elements in the stack.
  50. It must return true or false. If it returns false, stack.visit returns false immediately.
  51. See Also    stack.create
  52. stack.push
  53. stack.pop
  54. stack.dispose
  55.  
  56. Verb    stack.dispose
  57. Syntax    stack.dispose (adrStack)
  58. Parameters    adrStack is the address of a stack object allocated by stack.create.
  59. Action    Deletes the table storing the stack object.
  60. Returns    True.
  61. Examples    stack.dispose (scratchpad.nameStack)
  62.     « true
  63. See Also    stack.create
  64. stack.push
  65. stack.pop
  66. stack.visit
  67.